Skip to content

Feature/event catalog#270

Merged
MPapst merged 5 commits intomainfrom
feature/event-catalog
Apr 11, 2026
Merged

Feature/event catalog#270
MPapst merged 5 commits intomainfrom
feature/event-catalog

Conversation

@MPapst
Copy link
Copy Markdown
Collaborator

@MPapst MPapst commented Apr 11, 2026

This pull request introduces a new Event Catalog feature, providing a queryable registry of all events associated with entity types, complete with metadata and compile-time generated JSON Schemas. It includes a working sample (SampleEventCatalog), new APIs, and documentation updates. The Event Catalog enables runtime introspection, documentation, and validation of events, and supports filtering and detailed schema-based inspection.

Event Catalog Feature Implementation:

  • Added new IEventCatalog API and default implementation (EventCatalogProvider) for querying events and their metadata, including JSON Schema, by entity type and event name.
  • Introduced EventCatalogEntry and EventCatalogEventDetails records to represent lightweight and detailed event metadata, respectively. [1] [2]
  • Implemented EventCatalogRegistration for in-memory registration and lookup of events, supporting filtering by name and constraints.

Attribute and Metadata Enhancements:

  • Extended EventNameAttribute and introduced generic EventNameAttribute<TEntity> to allow associating events with entities, including optional description and constraints metadata.

Documentation and Sample:

  • Added comprehensive documentation for the Event Catalog, usage examples, and code generation in README.md.
  • Added a new sample project, SampleEventCatalog, demonstrating registration, querying, and JSON Schema validation of events. [1] [2] [3] [4]

Dependency Updates:

  • Added JsonSchema.Net package to support JSON Schema generation and validation.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new Event Catalog feature that lets consumers query registered events per entity type (including metadata and compile-time generated JSON Schemas), adds source-generator support to emit DI registration for the catalog, and provides a runnable sample + documentation.

Changes:

  • Added IEventCatalog API + default provider/registration types for event catalog listing and schema-backed event detail lookup.
  • Extended source generator to emit AddCodeGeneratedEventCatalog() and generate JSON Schemas for catalog entries.
  • Added tests, documentation, and a new SampleEventCatalog sample project demonstrating querying + schema validation.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/Papst.EventStore.Tests/EventCatalog/EventCatalogProviderTests.cs Adds unit tests covering registration, filtering, lazy schema evaluation, and entity-scoped/global lookups.
tests/Papst.EventStore.CodeGeneration.Tests/CodeGeneratorTests.cs Refactors tests to share compilation creation via a base class.
tests/Papst.EventStore.CodeGeneration.Tests/CodeGeneratorTestBase.cs Introduces shared CreateCompilation helper for codegen tests.
tests/Papst.EventStore.CodeGeneration.Tests/CodeGeneratorCatalogTests.cs Adds generator tests validating catalog method emission + embedded schema output.
src/Papst.EventStore/EventCatalog/IEventCatalogRegistration.cs Adds registration contract used for catalog population and lookup.
src/Papst.EventStore/EventCatalog/IEventCatalog.cs Adds public read API for listing events and retrieving schema-backed details.
src/Papst.EventStore/EventCatalog/EventCatalogRegistration.cs Implements in-memory catalog storage, filtering, and detail lookup with lazy schema evaluation.
src/Papst.EventStore/EventCatalog/EventCatalogProvider.cs Adds default IEventCatalog implementation that aggregates multiple registrations.
src/Papst.EventStore/EventCatalog/EventCatalogEventDetails.cs Adds record type for detailed event info including JSON schema.
src/Papst.EventStore/EventCatalog/EventCatalogEntry.cs Adds record type for lightweight catalog entries.
src/Papst.EventStore.CodeGeneration/EventRegistrationIncrementalCodeGenerator.cs Extends generator to build catalog entries, generate schema fields, and emit AddCodeGeneratedEventCatalog().
src/Papst.EventStore.Aggregation.EventRegistration/EventNameAttribute.cs Extends event naming attributes with Description/Constraints and adds generic EventNameAttribute<TEntity>.
samples/SampleEventCatalog/SampleEventCatalog.csproj Adds a new sample project referencing codegen + JsonSchema.Net.
samples/SampleEventCatalog/Program.cs Demonstrates catalog queries and JSON Schema validation.
samples/SampleEventCatalog/Events.cs Defines sample entities/events annotated for catalog generation.
README.md Documents Event Catalog usage and generated registration method.
Papst.EventStore.slnx Adds the new sample project to the solution.
Directory.Packages.props Adds centralized version for JsonSchema.Net.

Comment thread Directory.Packages.props
Comment thread src/Papst.EventStore/EventCatalog/IEventCatalogRegistration.cs Outdated
Comment thread src/Papst.EventStore/EventCatalog/EventCatalogRegistration.cs Outdated
MPapst added 2 commits April 11, 2026 17:20
- Introduced Event Catalog for managing events associated with entity types, including metadata and JSON Schema generation.
- Updated `ListEvents` and `GetEventDetails` methods in `EventCatalogProvider` to return `ValueTask` for better async performance.
- Enhanced `EventCatalogRegistration` to support entity-scoped event details retrieval.
- Added tests for event catalog generation, JSON Schema validation, and entity-scoped event details.
- Updated sample application to demonstrate new Event Catalog features and JSON Schema validation.
- Replaced `FluentAssertions` with `JsonSchema.Net` for JSON Schema handling.
@MPapst MPapst force-pushed the feature/event-catalog branch from 383e786 to 5f4f262 Compare April 11, 2026 15:20
@MPapst MPapst force-pushed the feature/event-catalog branch from 5f4f262 to ae1f13c Compare April 11, 2026 15:45
@MPapst MPapst merged commit 2d15427 into main Apr 11, 2026
1 check passed
@MPapst MPapst deleted the feature/event-catalog branch April 11, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants